/**
 * COPYRIGHT. Harry Wu 2011. ALL RIGHTS RESERVED.
 * Project: just-core
 * Authro: Harry Wu <harrywu304@gmail.com>
 * Created On: Apr 23, 2012 10:39:53 PM
 */
package org.justframework.util;

import java.net.URI;

/**
 *
 */
public class UriUtil {
	
	/**
	 * get host and port info
	 * @param uri
	 * @return
	 */
	public static String getHostPort(URI uri){
		String result = uri.getHost();
		int port = uri.getPort();
		if(port != -1){
			result += ":"+uri.getPort();
		}
		return result;
	}

}
